package com.project.bean;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDate;

public class SpeakBean {
    private int id;
    private BookBean bookBean;
    private UserBean userBean;
    private String content;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate speakDate = LocalDate.now();

    public SpeakBean() {
    }

    public SpeakBean(int userId,int bookId, String content) {
        this.bookBean = new BookBean();
        this.bookBean.setId(bookId);
        this.userBean = new UserBean();
        this.userBean.setId(userId);
        this.content = content;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public BookBean getBookBean() {
        return bookBean;
    }

    public void setBookBean(BookBean bookBean) {
        this.bookBean = bookBean;
    }

    public UserBean getUserBean() {
        return userBean;
    }

    public void setUserBean(UserBean userBean) {
        this.userBean = userBean;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public LocalDate getSpeakDate() {
        return speakDate;
    }

    public void setSpeakDate(LocalDate speakDate) {
        this.speakDate = speakDate;
    }

    @Override
    public String toString() {
        return "SpeakBean{" +
                "id=" + id +
                ", bookBean=" + bookBean +
                ", userBean=" + userBean +
                ", content='" + content + '\'' +
                ", speakDate=" + speakDate +
                "}\n";
    }
}
